package com.zhiyou.brank.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zhiyou.service.TeacherManageService;
import com.zhiyou.utils.JsonResult;

@RestController
@RequestMapping("brand_gate/")
public class Fly_Brand_Gate {
@Autowired
TeacherManageService teacherManageService;
	//智慧班牌的考勤查询的展示(如果id=1的话就是查询已出勤的,如果id!=1的话就是查询未出勤的)
	@GetMapping("invincible/{id}/{class_id}")
	public JsonResult zhanshi(@PathVariable("id")Integer id,@PathVariable("class_id")Integer class_id,HttpServletRequest request ,HttpServletResponse response){
		System.out.println("id是:"+id+";班级id是:"+class_id+".");
		return new JsonResult(teacherManageService.SelectUnify(id, class_id),"查询成功");
	}
	@PostMapping("Obscure")
	public JsonResult MHCX(Integer id,Integer class_id,String student_name,HttpServletRequest request ,HttpServletResponse response){
	System.out.println("id是:"+id+";班级id是:"+class_id+";学生模糊查:"+student_name+".");
	return new JsonResult(teacherManageService.SelectMHCX(id, class_id, student_name),"查询成功");
	}
	/**
	 * 未出勤人数
	 * @param class_id
	 * @param request
	 * @param response
	 * @return
	 */
	@GetMapping("selectCheckSum/{class_id}")
	public JsonResult selectCheckSum(@PathVariable("class_id")Integer class_id,HttpServletRequest request ,HttpServletResponse response){
		return new JsonResult(teacherManageService.selectCheckSum(class_id),"查询成功");
	}
}
